home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / lib / partman / mount.d / 70basic next >
Text File  |  2008-10-29  |  436b  |  32 lines

  1. #!/bin/sh
  2.  
  3. set -- $1
  4.  
  5. fs=$1
  6. mp=$2
  7. type=$3
  8. options=$4
  9. dump=$5
  10. pass=$6
  11.  
  12. case $type in
  13.     ext2|vfat|ntfs)
  14.     mount ${options:+-o "$options"} $fs /target$mp 3>&- || exit 1
  15.     echo "umount /target$mp"
  16.     exit 0
  17.     ;;
  18.     swap)
  19.     # Probably it's already swapped on.
  20.     if [ -f /proc/swaps ] && \
  21.        grep -q "^$(readlink -f "$fs") " /proc/swaps; then
  22.         echo "swapoff $fs"
  23.         exit 0
  24.     fi
  25.     swapon $fs || exit 1
  26.     echo "swapoff $fs"
  27.     exit 0
  28.     ;;
  29. esac
  30.  
  31. exit 1
  32.